<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<?php if(!isset($found)||!$found):?>
<?php if(!isset($project_name)): ?>
<div class="elementView" style="display:block;padding:10px;">
<h2>Upload media file</h2>
<form action="<?php echo url_for('importMedia/index') ?>" method="POST" enctype="multipart/form-data">
  <table id="uploadMedia_form">
  	<tfoot>
  		<tr>
  			<td colspan="2">
  				<input type="submit" name="submit" value="upload"/>
  			</td>
  		</tr>
  	</tfoot>
    <tbody>
      <?php echo $form ?>
    </tbody>
  </table>
</form>
</div>
<?php endif; ?>

<?php if(isset($project_name)): ?>
<?php if($project_name !== null): ?>

<?php slot("successMessages")?>
	The project <?php echo $project_name ?> has been successfuly loaded...
<?php end_slot();?>
<a href="<?php echo url_for("main/projectList")?>">OpenProject Project</a>

<?php else: ?>
<?php slot("errorMessages")?>
	Error with file !
<?php end_slot();?>

<?php  endif; ?>
<?php endif; ?>
<?php else: //if(found)?>
<?php slot("errorMessages")?>
	Project with same basename already exists !
<?php end_slot();?>
<a href="<?php echo url_for("importMedia/index")?>">Import Project</a>
<?php  endif; ?>